#include <iostream>
#include "../../src/thread/ConditionalVariable.h"
#include "../../src/thread/Thread.h"
#include "../../src/time/Time.h"
#include "../../src/tools/ShareApi.h"
#include "../test_type.h"

using namespace LibTools;
using namespace std;

static CConditionalVariable g_cv;
static CMutex g_mutex;

#ifdef TEST_CCONDITION
DWORD func(void *invoker)
{
	cout << "wait func exit time = " << CTimeTools::GetTimeStr() << endl;
	g_cv.Wait(10*1000, &g_mutex);
	cout << "exit func time = " << CTimeTools::GetTimeStr() << endl;
	return 0;
}

int main()
{
	CThread t(&func, NullPtr);

	ShareApi::Sleep(3*1000);
	g_cv.NotifyOne();

	t.Join();

	return 0;
}
#endif
